﻿using System.Data.Entity.ModelConfiguration;

namespace HobSoft.SoccerBet2014.Domain.Models.DbSchema
{
    public class MarketConfiguration : EntityTypeConfiguration<Market>
    {
        public MarketConfiguration(string schema = "dbo")
        {
            ToTable(schema + ".GameMarketList");
            HasKey(m => new { m.BmID, m.GameID, m.Host });
            Property(m => m.BmID).HasColumnName("BookerID").IsRequired();
            Property(m => m.GameID).HasColumnName("GameID").IsRequired().HasMaxLength(50).IsUnicode(false);
            Property(m => m.Host).HasColumnName("Host").IsRequired().HasMaxLength(200).IsUnicode(false);
            Property(m => m.UpdateAccount).HasColumnName("UpdateAccount").IsRequired().HasMaxLength(50).IsUnicode(false);
            Property(m => m.UpdateTime).HasColumnName("UpdateTime").IsRequired();
            Property(m => m.OddsIDSString).HasColumnName("OddsIDS").IsOptional().HasMaxLength(8000).IsUnicode(false);
            Ignore(m => m.OddsIDS);
            Ignore(m => m.Key);
        }
    }
}
